package com.ildepinc.persistence.interfaces;

import java.sql.Connection;
import java.sql.Statement;
import java.util.HashMap;
import java.util.Properties;

import org.apache.logging.log4j.Logger;

import com.ildepinc.persistence.abstracts.DaoTableAuditable;
import com.ildepinc.persistence.abstracts.DaoTableAuditableExpirable;
import com.ildepinc.persistence.abstracts.DaoTableGeneric;
import com.ildepinc.persistence.abstracts.DaoTableGenericExpirable;
import com.ildepinc.persistence.abstracts.SequenceGeneric;
import com.ildepinc.persistence.concretes.JdbcConnection;
import com.ildepinc.persistence.concretes.JdbcDriver;

public interface PersistenceLayerBehaviour {

  Boolean startLayer();

  Boolean stopLayer();

  void checkAndCreateTable(String schema, String table, String sqlDdl) throws Exception;

  void checkAndCreateSequence(String sequenceName, String sqlDdl) throws Exception;

  void checkAndCreeateSchema(String schema) throws Exception;

  JdbcDriver createJdbcDriver(Properties persistenceProperty) throws Exception;

  Boolean setup();

  Boolean setupDaos();

  Boolean setupSequences();

  Boolean setupSequenceGeneric(Boolean result);

  Boolean setupDaoTableAuditableExpirable(Boolean result);

  Boolean setupDaoTableAuditable(Boolean result);

  Boolean setupDaoTableGenericExpirable(Boolean result);

  Boolean setupDaoTableGeneric(Boolean result);

  void clear();

  Logger getLogger();

  void setLogger(Logger logger);

  Connection getConnection();

  void setConnection(Connection connection);

  Statement getStatement();

  void setStatement(Statement statement);

  JdbcConnection getJdbcConnection();

  void setJdbcConnection(JdbcConnection jdbcConnection);

  HashMap<String, DaoTableGeneric> getDaoTableGenericMap();

  void setDaoTableGenericMap(HashMap<String, DaoTableGeneric> daoTableGenericMap);

  HashMap<String, DaoTableGenericExpirable> getDaoTableGenericExpirableMap();

  void setDaoTableGenericExpirableMap(HashMap<String, DaoTableGenericExpirable> daoTableGenericExpirableMap);

  HashMap<String, DaoTableAuditable> getDaoTableAuditableMap();

  void setDaoTableAuditableMap(HashMap<String, DaoTableAuditable> daoTableAuditableMap);

  HashMap<String, DaoTableAuditableExpirable> getDaoTableAuditableExpirableMap();

  void setDaoTableAuditableExpirableMap(HashMap<String, DaoTableAuditableExpirable> daoTableAuditableExpirableMap);

  Properties getPersistenceProperties();

  void setPersistenceProperties(Properties persistenceProperties);

  Properties getEnvironmentProperties();

  void setEnvironmentProperties(Properties environmentProperties);

  HashMap<String, SequenceGeneric> getSequenceGenericMap();

  void setSequenceGenericMap(HashMap<String, SequenceGeneric> sequenceGenericMap);

}
